#pragma once

#include <vector>


#define ROW 9
#define COLUMN 11



struct Point
{
	int x;
	int y;
	int F;
	int G; //cost of now point to start point 
	int H; //cost of end point to now point 


};

struct Tree
{
	Point position;
	Tree* pFather;
	vector<Tree*> pChild;
};




class Astar
{
public:
	Astar();
	~Astar();
	void printData();
	void Process();
	int getH(Point end_point, Point position);
	bool addTree(Point position);

private:
	bool isEnd;
	Point start_point = { 2,2 };
	Point end_point = { 4,8 };
	bool supplementaryMap[ROW][COLUMN];
	vector<Tree*> buff;
	enum aroundPoint { up, down, left, right, left_up, left_down, right_up, right_down };
	int linerDistance;
	int tiltDistance;

	int mapData[ROW][COLUMN] = { { 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 },
	{ 0,0,0,0,0,0,0,0,0,0,0 },
	{ 0,0,0,0,0,1,0,0,0,0,0 } };


};

